#include "TImage.h"
#include "TCanvas.h"
#include "TArrayD.h"
#include "TROOT.h"
#include "TFile.h"
#include "TSystem.h"
#include "TColor.h"
#include "TH2F.h"
#include "TAttImage.h"
#include "TEnv.h"
#include "TASImage.h"
#include "TStyle.h"
#include <iostream>
#include <vector>
#include <fstream>
using namespace std;
void threeDRootGenerator()
{
    vector<string> paths;
    string line;
    ifstream file("rootPlots.txt");
    while(getline (file, line))
        paths.push_back(line);
    file.close();
    cout<<paths.size()<<endl;
    TFile file2("tan(beta)-10_3D_CPV_13.root","RECREATE");
    TCanvas *canv = new TCanvas(); 
    TImage *img[paths.size()];
    for(int i = 0 ; i < paths.size() ; i++)
    {
        string tmp = "";
        for(int j = 6 ; paths[i][j] != '.' ; j++)
            tmp += paths[i][j];
        img[i] = TImage::Open(paths[i].c_str());
        img[i]->SetEditable(true);
        img[i]->Draw();
        img[i]->Write(tmp.c_str());
    }
    file2.Close();
}
